#include "debug.h"
#include "globals.h"
#include "keypad_state.h"

int poll_keypad_state(void)
{
    /* TODO: Do something here */
    
    return KEYP_NO_INPUT;
}

int keypad_check_state(void)
{
    int func_retval = 0;
    
    func_retval = poll_keypad_state();
    if (func_retval != KEYP_NO_INPUT)
    {
        /* Switch state to keypad io handler */
        return STATE_HANDLE_KEYPAD_IO;
    }
    else
    {
        /* No input - handle remaining arm movements */
        return STATE_ARM_MOVEMENT;
    } 
}

int keypad_handle_io_state(void)
{
    /* TODO: Register keypad input, do something suitable, update state */
    
    return STATE_ARM_MOVEMENT;
}
